package com.kczd.jinlan.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.adapter.normaladapter.BaseCommAdapter;
import com.kczd.jinlan.adapter.normaladapter.ViewHolder;
import com.kczd.jinlan.model.Evaluate;

import java.util.List;

/**
 * zhangy
 * Created by Administrator on 2017/5/22.
 */

public class EvaluateAdapter extends BaseCommAdapter<Evaluate> {
    public EvaluateAdapter(List<Evaluate> datas) {
        super(datas);
    }

    @Override
    protected void setUI(ViewHolder holder, int position, Context context) {
        Evaluate item = getItem(position);
        ImageView image = holder.getItemView(R.id.image);
        image.setImageResource(item.image);

        TextView text_title_list = holder.getItemView(R.id.text_title_list);
        text_title_list.setText(item.title_ev);
        TextView text_data = holder.getItemView(R.id.text_data);
        text_data.setText(item.data_ev);
        TextView text_time = holder.getItemView(R.id.text_time);
        text_time.setText(item.time_ev);
        TextView text_comment = holder.getItemView(R.id.text_comment);
        text_comment.setText(item.comment);
        ImageView image_title = holder.getItemView(R.id.image_title);
        image_title.setImageResource(item.image_title);
        TextView text_title_item = holder.getItemView(R.id.text_title_item);
        text_title_item.setText(item.title_item);
        TextView text_kg = holder.getItemView(R.id.text_kg);
        text_kg.setText(item.text_kg);
        TextView text_kg1 = holder.getItemView(R.id.text_kg1);
        text_kg1.setText(item.text_kg1);

        TextView text_xianjia = holder.getItemView(R.id.text_xianjia);
        text_xianjia.setText(item.text_xianjia);
        TextView text_yuanjia = holder.getItemView(R.id.text_yuanjia);
        text_yuanjia.setText(item.text_yuanjia);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.item_list_evaluate;
    }
}
